package com.cy6;

/**
 * 学生类
 *
 * @author CY
 * @date 2022/08/04 09:43
 **/
public class Student {
    private String name;
    private int age;
    public Student(){
        System.out.println("实例成功！");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void test1() {
        System.out.println(name + ":" + age);
    }

    public void test2() {
        this.test1();
    }

    public static void main(String[] args) {
        Student s = new Student();
        s.setAge(18);
        s.setName("张曼玉");
        s.test2();
    }

}
class StudentDemo{
    private int name1;

    StudentDemo(){
        System.out.println("实例成功！");

    }
}